Free caches on shutdown
authorMatthias Clasen <matthiasc@src.gnome.org>
Thu, 20 Jul 2006 14:40:57 +0000 (14:40 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Thu, 20 Jul 2006 14:40:57 +0000 (14:40 +0000)
gtk/xdgmime/ChangeLog
gtk/xdgmime/xdgmime.c

index 0105cfafb2e2a3fc920e5a04f6511793f8fc9d4d..5b25f9ff31826643ac131d1bc70454f56b010f56 100644 (file)
@@ -1,5 +1,8 @@
 2006-07-20  Matthias Clasen  <mclasen@redhat.com>
 
+       * xdgmime.c (xdg_mime_shutdown): Unref the caches.
+       Patch by Yevgen Muntyan, bugs.freedesktop.org #7496
+
        * xdgmimemagic.c: 
        * xdgmime.c: 
        * xdgmime.h: Add xdg_init-free versions of some
index 16026cf1fd763f8b997fe84499e5d90f190dcb12..23be62b0405b147828351a07a551c7d029bbcf20 100644 (file)
@@ -584,6 +584,17 @@ xdg_mime_shutdown (void)
       parent_list = NULL;
     }
   
+  if (_caches)
+    {
+      int i;
+
+      for (i = 0; i < n_caches; i++)
+        _xdg_mime_cache_unref (_caches[i]);
+      free (_caches);
+      _caches = NULL;
+      n_caches = 0;
+    }
+
   for (list = callback_list; list; list = list->next)
     (list->callback) (list->data);